package br.ufrj.ppgi.greco.model.dao;

import java.util.List;

import javax.persistence.EntityManager;

import br.com.caelum.vraptor.ioc.Component;
import br.ufrj.ppgi.greco.model.entity.EntityResource;

@Component
public class DAOResource extends DAOGeneric<EntityResource>
{
	public DAOResource(EntityManager em)
	{
		super(em);
	}
	
	public String getAllResourcesJson()
	{
		String result = "[";
		List<EntityResource> listRes=  this.getAll();
		for(EntityResource res : listRes)
		{
			result+= "'"+res.getUri()+"',";
		}	
		result += "];";
		return result;
	}
	
}
